﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" Culture="th-TH" uiCulture="th" AutoEventWireup="true" CodeBehind="PS_RoyalItemControls.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.PS_RoyalItemControls" %>
<%@ Register src="../Controls/EmployeeTypeCombo.ascx" tagname="EmployeeTypeCombo" tagprefix="uc1" %>
<%@ Register src="../Controls/MasterYear.ascx" tagname="MasterYear" tagprefix="uc2" %>
<%@ Register src="../Controls/user.ascx" tagname="user" tagprefix="uc3" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<asp:Content 
    ID="Content1" 
    runat="server" 
    contentplaceholderid="ContentPlaceHolder1">
    
    <title>บัญชีคุมเครื่องราชอิสริยาภรณ์</title>
    <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" />    
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">        
            <script type="text/javascript">
                function onTextChange(sender) 
                {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
                }
                                
            </script>       
    </telerik:RadCodeBlock>    
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID ="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>

    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" 
        Height="100%" Width="75px" Transparency="50">
        <table style="height: 100%; width: 100%" border="0">
            <tr>
                <td width="100%" align="center" valign="middle">
                    <img alt="Loading..." 
                        src="../Images/Buttons/loading.gif" 
                        style="border: 0px;" />
                </td>
            </tr>
        </table>
    </telerik:RadAjaxLoadingPanel>
    <table>
        <tr>
        <td colspan = "2">
            <!-- <uc3:user ID="user1" runat="server" /> -->
        </td>
         <td align = "left"> 
         <div class="moduleDivSlim700">
         <div class="moduleDivBottom700">
         <table width = "650px" align ="center">
         <tr>
         <td>ปีที่ขอ :</td>
         <td>
          <uc2:MasterYear ID="cbYear" runat="server" />
         </td>
         <td>ประเภทบุคลากร :</td>
         <td> 
         <uc1:EmployeeTypeCombo ID="cbEmployeeType" runat="server" />        
         </td>
         <td>         
         <asp:Button 
            ID="cmdFilter" 
            Text = "กรองข้อมูล"            
            runat="server" onclick="cmdFilter_Click"/>     
         </td>
         </tr>
         </table>
        </div>
        </div>
        </td>

        </tr>
        <tr>
        <td colspan ="3" >
        <div class="moduleDivSlim1000">
         <div class="moduleDivBottom1000">
        <asp:Panel Height="390px" Width = "1000px" runat = "server" ID = "PanelMain" ScrollBars ="Auto">
        <table align ="center" width = "100%">
        <tr>
        <td class ="tableHeader" colspan ="3">
        <asp:Label ID="Label3" runat="server" Text = "บัญชีคุมเครื่องราชอิสริยาภรณ์" Height="20px" ></asp:Label>
        </td>
        </tr>
        <tr>
        <td valign = "top">
                    <telerik:RadGrid 
                            ID="RadGrid1" 
                            runat="server" 
                            AllowAutomaticDeletes="True" 
                            AllowFilteringByColumn="True" 
                            AllowMultiRowEdit="True" 
                            AllowMultiRowSelection="True" 
                            AllowPaging="True" 
                            AllowSorting="True" 
                            AutoGenerateColumns="False" 
                            EnableAJAX="True" 
                            EnableAJAXLoadingTemplate="True" 
                            GridLines="None" 
                            OnItemCommand="RadGrid1_ItemCommand" 
                            Skin="Outlook" 
                            Width="100%">
                            <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" 
                                ClientDataKeyNames="Employee.Sequence" 
                                CommandItemDisplay="Top" 
                                DataKeyNames="Employee.Sequence" 
                                InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                                NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                                <CommandItemTemplate>
                                    <table width="100%">
                                        <tr>
                                            <td>
                                            <asp:LinkButton ID="cmdSendAll" runat="server" CommandName="SendAll" 
                                            OnClientClick="javascript:return confirm('แจ้งเวียนบุคลากรที่เลือกไว้ทั้งหมดหรือไม่?')" 
                                            Visible="<%# !RadGrid1.MasterTableView.IsItemInserted && RadGrid1.EditIndexes.Count <= 0 %>" CausesValidation="False"><img 
                                            style="border:0px;vertical-align:middle;" alt=""
                                            src="../Images/Buttons/mail_gr.gif" /> แจ้งเวียน</asp:LinkButton>    
                                            </td>
                                            <td align="right">
                                                
                                            </td>
                                        </tr>
                                    </table>
                                </CommandItemTemplate>
                                <RowIndicatorColumn>
                                    <HeaderStyle Width="15px" />
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn>
                                    <HeaderStyle Width="15px" />
                                </ExpandCollapseColumn>

                                <Columns>
                                    <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" ItemStyle-Width="15">
                                        <ItemStyle Width="15px" />
                                    </telerik:GridClientSelectColumn>
                                    
                                    <telerik:GridTemplateColumn
                                        HeaderText = "ชื่อ - นามสกุล"
                                        FilterControlWidth = "100%"
                                        AutoPostBackOnFilter="true" 
                                        CurrentFilterFunction="Contains" 
                                        ShowFilterIcon="False">
                                        <HeaderStyle Width = "150px" />
                                    <ItemTemplate>
                                    <%# Eval("Employee.Person.NamePrefix.Name")%> <%# Eval("Employee.Person.FirstName")%> 
                                        &nbsp;<%#Eval("Employee.Person.LastName")%> 
                                    </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridBoundColumn 
                                        DataField="Employee.LatestPositionDate" 
                                        DataFormatString = "{0:dd/MM/yyyy}"
                                        FilterControlWidth = "100%"
                                        AutoPostBackOnFilter ="true"
                                        ShowFilterIcon ="false"
                                        HeaderStyle-HorizontalAlign="Center" 
                                        HeaderText="ดำรงตำแหน่งปัจจุบันเมื่อวันที่" 
                                        UniqueName="Employee.LatestPositionDate">
                                        <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn 
                                        DataField="Employee.AdmittedDate" 
                                        DataFormatString = "{0:dd/MM/yyyy}"
                                        FilterControlWidth = "100%"
                                        AutoPostBackOnFilter ="true"
                                        ShowFilterIcon ="false"
                                        HeaderStyle-HorizontalAlign="Center" 
                                        HeaderText="วันเริ่มรับราชการ" 
                                        UniqueName="Employee.AdmittedDate">
                                        <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Item34"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="บม.[ได้] " 
                                        UniqueName="Item34">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Return34"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="บม.[คืน] " 
                                        UniqueName="Return34">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Item33"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="บช.[ได้] " 
                                        UniqueName="Item33">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Return33"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="บช.[คืน] " 
                                        UniqueName="Return33">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Item29"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="จม.[ได้] " 
                                        UniqueName="Item29">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Return29"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="จม.[คืน] " 
                                        UniqueName="Return29">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Item28"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="จช.[ได้] " 
                                        UniqueName="Item28">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Return28"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="จช.[คืน] " 
                                        UniqueName="Return28">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Item24"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="ตม.[ได้] " 
                                        UniqueName="Item24">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Return24"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="ตม.[คืน] " 
                                        UniqueName="Return24">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Item23"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="ตช.[ได้] " 
                                        UniqueName="Item23">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Return23"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="ตช.[คืน] " 
                                        UniqueName="Return23">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Item16"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="ทม.[ได้] " 
                                        UniqueName="Item16">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Return16"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="ทม.[คืน] " 
                                        UniqueName="Return16">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Item15"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="ทช.[ได้] " 
                                        UniqueName="Item15">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Return15"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="ทช.[คืน] " 
                                        UniqueName="Return15">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Item11"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="ปม.[ได้] " 
                                        UniqueName="Item11">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Return11"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="ปม.[คืน] " 
                                        UniqueName="Return11">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Item10"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="ปช.[ได้] " 
                                        UniqueName="Item10">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Return10"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="ปช.[คืน] " 
                                        UniqueName="Return10">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Item09"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="ม.ว.ม.[ได้] " 
                                        UniqueName="Item09">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Return09"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="ม.ว.ม.[คืน] " 
                                        UniqueName="Return09">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Item08"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="ม.ป.ช.[ได้] " 
                                        UniqueName="Item08">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Return08"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="ม.ป.ช.[คืน] " 
                                        UniqueName="Return08">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  
                                        DataField="Item61"                                      
                                        HeaderStyle-HorizontalAlign="Center" 
                                        FilterControlWidth ="100%"
                                        ShowFilterIcon ="false" 
                                        CurrentFilterFunction = "Contains"
                                        AutoPostBackOnFilter="true"             
                                        HeaderText="ร.จ.พ. " 
                                        UniqueName="Item61">
                                    <HeaderStyle HorizontalAlign="Center" Width="50px"/>
                                    </telerik:GridBoundColumn>
                                </Columns>
                                <EditFormSettings 
                                    EditFormType="WebUserControl" 
                                    UserControlName="../UserControls/PS_RoyalItemControls.ascx">
                                    <EditColumn UniqueName="EditCommandColumn1"></EditColumn>
                                </EditFormSettings>
                                <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                            </MasterTableView>
                            <ClientSettings AllowColumnHide="True" 
                                AllowColumnsReorder="True" 
                                EnableRowHoverStyle="True" 
                                ReorderColumnsOnClient="True">
                                <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
                                </ClientSettings>
                        </telerik:RadGrid>
                   
                   </td>
                   </tr>
                   </table>
                   </asp:Panel>
                   </div>
                   </div>
                   </td>
                   </tr>
                   </table>
</asp:Content>
